package cn.fl.finance.controller;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

import cmm.comm.facade.framework.api.ISysDictionaryApiService;
import cmm.mid.core.framework.dto.DataResultDTO;
import cmm.mid.core.framework.page.DataResultVO;
import cmm.mid.core.framework.page.KeyValueVO;
import cmm.mid.core.framework.page.ListPageVO;
import cn.cmm.base.framework.constant.BaseConstant;
import cn.cmm.base.framework.constant.BaseExceptionConstant;
import cn.cmm.base.framework.exception.BaseException;
import cn.cmm.base.framework.utils.BaseLogUtils;
import cn.cmm.base.framework.utils.CollectionUtils;
import cn.cmm.base.framework.utils.DateUtils;
import cn.cmm.base.framework.utils.DecimalUtils;
import cn.cmm.base.framework.utils.StringUtils;
import cn.fl.capital.service.ICapFundApiService;
import cn.fl.capital.transform.CapFundVOTransform;
import cn.fl.capital.vo.CapFundVO;
import cn.fl.finance.api.IFinPayFeeApiService;
import cn.fl.finance.api.IFinRepayApplyInfoApiService;
import cn.fl.finance.constant.FinLoanConstant;
import cn.fl.finance.dto.FinPayDtlDTO;
import cn.fl.finance.dto.FinRefundAccDTO;
import cn.fl.finance.dto.FinRepayApplyInfoDTO;
import cn.fl.framework.base.context.CurrentThreadContext;
import cn.fl.project.condition.PrjPrdPaySchDQueryCondition;
import cn.fl.project.dto.PrjPrdPaySchDDTO;
import cn.fl.project.service.IPrjPrdPaySchDApiService;
import cn.fl.system.constant.SysLogConstant;
import net.sf.json.JSONArray;

/**
 * 借款信息
 * 作者:holly
 * 时间:2018/9/27
 */
@Controller
@RequestMapping("/finpayschfee/finance")
public class FinPaySchFeeController {
	private static final Logger logger = LoggerFactory.getLogger(FinPaySchFeeController.class);
    @Autowired
    private IPrjPrdPaySchDApiService prjPrdPaySchDApiService;
    @Autowired
    private ISysDictionaryApiService sysDictionaryApiService; 
    
    @Autowired
    private IFinPayFeeApiService finPayFeeApiService;
    @Autowired
    private IFinRepayApplyInfoApiService finRepayApplyInfoApiService;
    /**
     * 选择来款绑定流程
     * @param request
     * @param response
     * @return
     */
    @RequestMapping(value = "/toChooseFund.do", method = {RequestMethod.GET})
    public ModelAndView toChooseFund(HttpServletRequest request, HttpServletResponse response){
        BaseLogUtils.info(logger, "toChooseFund", "到选择来款绑定流程页面.", CurrentThreadContext.getCurrentUserName());
        String cstId = request.getParameter("cstId");
        String cstNm = request.getParameter("cstNm");
        String repayDtlId = request.getParameter("repayDtlId");
        String type = request.getParameter("type");
        //业务类型 1.结清 2.添加风险保证金
        String bizTypCd = request.getParameter("bizTypCd");
        if(  StringUtils.isEmpty(repayDtlId)){
            BaseLogUtils.info(logger, "toChooseFund", "到选择来款绑定流程页面失败，参数不全.", CurrentThreadContext.getCurrentUserName());
            throw new BaseException(BaseExceptionConstant.BASE_EXCEPTION_CODE_600,"请求参数不完整");
        }
        ModelAndView mav = new ModelAndView("finance/finRepayApplyInfo/repayChooseFund");
        mav.addObject("cstId", cstId);
        mav.addObject("cstNm", cstNm);
        mav.addObject("repayDtlId", repayDtlId);
        mav.addObject("type",type);
        mav.addObject("bizTypCd",bizTypCd);
        return mav;
    }
    /**
     * 新增银行账号页面
     * @param model
     * @return
     */
    @RequestMapping("/toAddBankPage.do")
    public ModelAndView toAddPage(ModelAndView model){
        // bank dictionary list
        List<KeyValueVO> bankDicList = sysDictionaryApiService.getKvList(FinLoanConstant.FIN_BANK_DIC, FinLoanConstant.SYS_CD, FinLoanConstant.ORG_CD);
        List<KeyValueVO> accTypDicList = sysDictionaryApiService.getKvList(FinLoanConstant.FIN_ACC_TYP_DIC, FinLoanConstant.SYS_CD, FinLoanConstant.ORG_CD);
        model.addObject("bankDicList",bankDicList);
        model.addObject("accTypDicList",accTypDicList);
        //model.setViewName("finance/loan/apply/finLoanApplyBankAccountAdd");
        model.setViewName("finance/finRepayApplyInfo/repayApplyInBankAdd");
        return model;
    }
    /**
     * 查询退款账户列表
     * @param request
     * @param response
     * @return
     * @throws BaseException
     */
	@RequestMapping(value = "/selectRepayBankList.do", method = {RequestMethod.GET })
	@ResponseBody
	public Object selectRepayBankList(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		String repayId = request.getParameter("repayId");
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_DELETE_SUCC);
		if(StringUtils.isEmpty(repayId)){
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
			return result;
		}
		List<FinRefundAccDTO> list = new ArrayList<>();
		try {
			  list=this.finPayFeeApiService.selectRepayBankList(Long.valueOf(repayId));
			BaseLogUtils.info(logger, "selectRepayBankList", "查询退款账户列表.[id="+repayId+"]", CurrentThreadContext.getCurrentUserName());
		}catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "selectRepayBankList", "查询退款账户列表失败.[id="+repayId+"]"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "selectRepayBankList", "查询退款账户列表失败.[id="+repayId+"]"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}

		return new ListPageVO<>(list, list.size());
	}
	
	/**
	 * 绑定退款银行卡
	 * @param request
	 * @param response
	 * @return
	 * @throws BaseException
	 */
	@RequestMapping(value = "/bindBankAcc.do", method = {RequestMethod.GET })
	@ResponseBody
	public Object bindBankAcc(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		String repayId = request.getParameter("repayId");
		String bankAccId = request.getParameter("bankAccId");
		DataResultDTO result = new DataResultDTO("1", SysLogConstant.LOG_CMM_DELETE_SUCC);
		if(StringUtils.isEmpty(repayId)||StringUtils.isEmpty(bankAccId)){
			result.setCode("0");
			result.setInfo("bankAccId和repayId不可为空");
			return result;
		}
		List<FinRefundAccDTO> list = new ArrayList<>();
		try {
			result =this.finPayFeeApiService.bindBankAcc(Long.valueOf(repayId),Long.valueOf(bankAccId));
			BaseLogUtils.info(logger, "bindBankAcc", "绑定退款银行卡.[id="+repayId+"]", CurrentThreadContext.getCurrentUserName());
		}catch (BaseException ex) {
			result.setCode("0");
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "bindBankAcc", "绑定退款银行卡失败.[id="+repayId+"]"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}catch (Exception ex) {
			result.setCode("0");
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "bindBankAcc", "绑定退款银行卡失败.[id="+repayId+"]"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}

		return result;
	}
	@RequestMapping(value = "/removeBankById.do", method = {RequestMethod.GET,RequestMethod.POST })
	@ResponseBody
	public Object removeBankById(HttpServletRequest request, HttpServletResponse response
			,@RequestParam(required = true)Long repayId,@RequestParam(required = true)Long refundId) throws BaseException {
		DataResultDTO result = new DataResultDTO("1", SysLogConstant.LOG_CMM_DELETE_SUCC);
		if(StringUtils.isEmpty(repayId)||StringUtils.isEmpty(refundId)){
			result.setCode("0");
			result.setInfo("refundId和repayId不可为空");
			return result;
		}
		List<FinRefundAccDTO> list = new ArrayList<>();
		try {
			result =this.finPayFeeApiService.removeBankByRepayId(Long.valueOf(repayId),Long.valueOf(refundId));
			BaseLogUtils.info(logger, "removeBankById", "解除绑定退款银行卡.[id="+repayId+"]", CurrentThreadContext.getCurrentUserName());
		}catch (BaseException ex) {
			result.setCode("0");
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "removeBankById", "解除绑定退款银行卡失败.[id="+repayId+"]"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}catch (Exception ex) {
			result.setCode("0");
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "removeBankById", "解除绑定退款银行卡失败.[id="+repayId+"]"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
		
		return result;
	}
	@Autowired
	private ICapFundApiService capFundApiService;
	
	/**
	 * 绑定资金
	 * @param request
	 * @param response
	 * @return
	 * @throws BaseException
	 */
	@RequestMapping(value = "/confirmFund.do", method = {RequestMethod.POST})
    @ResponseBody
    public Object confirmFund(HttpServletRequest request, HttpServletResponse response
    		 ) throws BaseException {
		DataResultDTO result = new DataResultDTO("1", SysLogConstant.LOG_CMM_OPERATE_SUCC);
        CapFundVO entity = null;
        try {
            String ids = request.getParameter("ids");//客户ID

            if (StringUtils.isEmpty(ids)) {
                result.setCode("0");
                result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
                BaseLogUtils.info(logger, "confirmFund", "认款修改CapFund信息,主键参数为空！.", CurrentThreadContext.getCurrentUserName());
                return result;
            }
            String cstId = request.getParameter("cstId");//客户ID
            String cstNm = request.getParameter("cstNm");//客户名称
           // String isNeedVf = request.getParameter("vfFlag");//是否需要自动核销
            String docketRem = request.getParameter("docketRem");//认款备注
            //String paySchIds = request.getParameter("paySchIdList");//支付表集合
            String relationPayId = request.getParameter("repayDtlId");//关联ID

            entity = new CapFundVO();
            /*if (StringUtils.isNotEmpty(isNeedVf)) {
                entity.setIsNeedVf(Integer.parseInt(isNeedVf));
            }*/
            if (StringUtils.isNotBlank(docketRem)) {
                entity.setDocketRem(docketRem);
            }
            /*if(StringUtils.isNotBlank(paySchIds)){
                entity.setPaySchIds(paySchIds);
            }*/
            if( ids!=null){
                List<Long> idsList = new ArrayList<>();
                JSONArray idsArray = JSONArray.fromObject(ids);
                for (Object object : idsArray) {
                    idsList.add(Long.valueOf(object.toString()));
                }
                entity.setIdList(idsList);
            }
            if(StringUtils.isNotEmpty(relationPayId)){
                entity.setRelationPayId(Long.valueOf(relationPayId));
            }

            if (StringUtils.isBlank(cstId)) {//重置
                BaseLogUtils.info(logger, "confirmFund", "重置认款[" + ids + "]", CurrentThreadContext.getCurrentUserName());
                entity.setCstId(null);//承租人ID
                entity.setCstNm(null);//承租人名称
                entity.setIdentifyOperator(null);//认款人ID
                entity.setIdentifyOperatorNm(null);//认款人
                entity.setIdentifyTime(null);
                entity.setMdfUsrId(CurrentThreadContext.getCurrentUserId());

            } else {
                BaseLogUtils.info(logger, "confirmFund", "认款[资金ID=" + ids + ",客户ID=" + cstId + ",操作人ID=" + CurrentThreadContext.getCurrentUserId() + "]", CurrentThreadContext.getCurrentUserName());
                entity.setCstId(Long.valueOf(cstId));//承租人ID
                entity.setCstNm(cstNm);//承租人名称
                entity.setIdentifyOperator(CurrentThreadContext.getCurrentUserId());//认款人ID
                entity.setIdentifyOperatorNm(CurrentThreadContext.getCurrentUserName());//认款人
                entity.setIdentifyTime(new Date());
                entity.setMdfUsrId(CurrentThreadContext.getCurrentUserId());
            }
            //修改资金所属客户信息
            BaseLogUtils.info(logger, "confirmFund", "调用资金认款API=>参数:" +JSON.toJSONString(entity));
             DataResultDTO resultDTO = this.capFundApiService.modifyFundCstInfo(CapFundVOTransform.toDTO(entity));
             BaseLogUtils.info(logger, "confirmFund", "调用资金认款API=>结果:" +JSON.toJSONString(resultDTO));
             if(resultDTO.getCode().equals("1")) {//成功 
            	 if (StringUtils.isBlank(cstId)) {//重置还款
                     BaseLogUtils.info(logger, "confirmFund", "调用还款关系=>重置:"  );
            		 this.finPayFeeApiService.confirmFund(Long.valueOf(relationPayId),entity.getIdList(),BaseConstant.IS_YESNO_YES);
            	 }else {//认款,绑定
            		 BaseLogUtils.info(logger, "confirmFund", "调用还款关系=>绑定:" );
            		 this.finPayFeeApiService.confirmFund(Long.valueOf(relationPayId),entity.getIdList(),BaseConstant.IS_YESNO_NO);
            		 
            	 }
             }
        } catch (BaseException ex) {
            result.setCode("0");
            result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR + ex.getMessage());
            BaseLogUtils.info(logger, "confirmFund", "认款修改CapFund数据失败.DATA:" + JSONObject.toJSONString(entity) + ".ERROR:" + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
        } catch (Exception ex) {
            result.setCode("0");
            result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR + ex.getMessage());
            BaseLogUtils.error(logger, "confirmFund", "认款修改CapFund数据失败,系统错误.DATA:" + JSONObject.toJSONString(entity) + ".ERROR:" + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
        }
        return result;
    }
	/**
	 * 保存来款处理方式
	 * @param request
	 * @param response
	 * @param repayId
	 * @param refundId
	 * @return
	 * @throws BaseException
	 */
	@RequestMapping(value = "/addhandleWayCd.do", method = {RequestMethod.GET,RequestMethod.POST })
	@ResponseBody
	public Object addhandleWayCd(HttpServletRequest request, HttpServletResponse response
			,@RequestParam(required = true)Long repayId,@RequestParam(required = true)Long usedAmount,@RequestParam(required = true)String handleWayCd) throws BaseException {
		DataResultDTO result = new DataResultDTO("1", SysLogConstant.LOG_CMM_DELETE_SUCC);
		if(StringUtils.isEmpty(repayId)||StringUtils.isEmpty(handleWayCd)){
			result.setCode("0");
			result.setInfo("handleWayCd和repayId不可为空");
			return result;
		}
		List<FinRefundAccDTO> list = new ArrayList<>();
		try {
			FinRepayApplyInfoDTO _dto= new FinRepayApplyInfoDTO();
			_dto.setId(repayId);
			_dto.setHandleWayCd(handleWayCd);
			boolean b= this.finRepayApplyInfoApiService.modifyRepayApplyInfo(_dto) ;
			BaseLogUtils.info(logger, "addhandleWayCd", "来款处理方式.[repayId="+repayId+",handleWayCd="+handleWayCd+" ]", CurrentThreadContext.getCurrentUserName());
			//更改退款账户中的金额
			this.finPayFeeApiService.modifyUseAmount(repayId,usedAmount);
		}catch (BaseException ex) {
			result.setCode("0");
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "addhandleWayCd", "来款处理方式失败.[repayId="+repayId+",handleWayCd="+handleWayCd+" ]"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}catch (Exception ex) {
			result.setCode("0");
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "addhandleWayCd", "来款处理方式失败.[repayId="+repayId+",handleWayCd="+handleWayCd+" ]"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
		
		return result;
	}
	
	/**
	 * 查询退款 实际放款金额和时间
	 * @param repayId
	 * @return
	 * @throws BaseException
	 */
	@RequestMapping(value = "/selectTuiPay.do", method = {RequestMethod.GET,RequestMethod.GET })
	@ResponseBody
	public Object selectTuiPay(HttpServletRequest request, HttpServletResponse response
			,@RequestParam(required = true)Long repayId ) throws BaseException {
		DataResultDTO result = new DataResultDTO("1", SysLogConstant.LOG_CMM_DELETE_SUCC);
		if(StringUtils.isEmpty(repayId) ){
			result.setCode("0");
			result.setInfo(" repayId不可为空");
			return result;
		}
		List<FinRefundAccDTO> list = new ArrayList<>();
		try {
			 
			FinRefundAccDTO _dto =this.finPayFeeApiService.selectTuiPay(repayId);
			_dto.setActPayAmt(DecimalUtils.div(_dto.getActPayAmt(), 100, 2));
			BaseLogUtils.info(logger, "selectTuiPay", "查询退款 实际放款金额和时间.[repayId="+repayId+" _dto :"+JSON.toJSONString(_dto), CurrentThreadContext.getCurrentUserName());
			list.add(_dto);
		}catch (BaseException ex) {
			result.setCode("0");
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "selectTuiPay", "查询退款 实际放款金额和时间失败.[repayId="+repayId+" ]"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}catch (Exception ex) {
			result.setCode("0");
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "selectTuiPay", "查询退款 实际放款金额和时间失败.[repayId="+repayId+"  ]"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
		return new ListPageVO<>(list, list.size());
	}
	
	/**
	 * 保存退款 实际放款金额和时间
	 * @param request
	 * @param response
	 * @param repayId
	 * @return
	 * @throws BaseException
	 */
	@RequestMapping(value = "/addTuiPay.do", method = {RequestMethod.GET,RequestMethod.GET })
	@ResponseBody
	public Object addTuiPay(HttpServletRequest request, HttpServletResponse response ) throws BaseException {
		DataResultDTO result = new DataResultDTO("1", SysLogConstant.LOG_CMM_DELETE_SUCC);
        String refundAccId = request.getParameter("refundAccId");//客户名称
        String actPayTm = request.getParameter("actPayTm");//客户名称
        String actPayAmt = request.getParameter("actPayAmt");//客户名称

		if(StringUtils.isEmpty(refundAccId)|| StringUtils.isEmpty(actPayTm)||StringUtils.isEmpty(actPayAmt)){
			result.setCode("0");
			result.setInfo("actPayAmt,actPayTm,refundAccId不可为空");
			return result;
		}
		try {
			FinRefundAccDTO dto = new FinRefundAccDTO();
			dto.setId(Long.valueOf(refundAccId));
			dto.setActPayAmt(Double.valueOf(actPayAmt));
			dto.setActPayTm(DateUtils.formatStringToDate(actPayTm, DateUtils.YYYY_MM_DD));
			result =this.finPayFeeApiService.addTuiPay(dto);
			BaseLogUtils.info(logger, "addTuiPay", "保存退款 实际放款金额和时间.[refundAccId="+refundAccId+" _dto :"+JSON.toJSONString(result), CurrentThreadContext.getCurrentUserName());
		}catch (BaseException ex) {
			result.setCode("0");
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "addTuiPay", "保存退款 实际放款金额和时间失败.[refundAccId="+refundAccId+" ]"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}catch (Exception ex) {
			result.setCode("0");
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "addTuiPay", "保存退款 实际放款金额和时间失败.[refundAccId="+refundAccId+"  ]"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
		return result;
	}
	
	
    /**
     * 借款信息列表
     * @return
     */
    @RequestMapping("/getPaySchFeeList.do")
    @ResponseBody
    public ListPageVO getPaySchFeeList(Long paySchId){
    	if(StringUtils.isEmpty(paySchId)) {
    		return null;
    	}
    	PrjPrdPaySchDQueryCondition condition = new PrjPrdPaySchDQueryCondition();
    	condition.setPaySchId(paySchId);
    	condition.setFeeClsCd("FIN10001");
    	BaseLogUtils.info(logger, "getPaySchFeeList", "加载借款信息列表,参数"+JSON.toJSONString(condition) );
    	List<PrjPrdPaySchDDTO> paySchDList = this.prjPrdPaySchDApiService.searchPrjPrdPaySchDList(condition);
		BaseLogUtils.info(logger, "getPaySchFeeList", "加载借款信息列表,结果"+JSON.toJSONString(paySchDList) );
		List<Map<String, Object>> resultList = new ArrayList<>();
		if (CollectionUtils.isNotEmpty(paySchDList)) {
			Map<String, String> map = this.sysDictionaryApiService.searchGroupToMap ("11000", "0000", "FIN10001");
			List<FinPayDtlDTO> fillFlowHis = this.finPayFeeApiService.fillFlowHis(paySchId);
				for (PrjPrdPaySchDDTO prjPrdPaySchDDTO : paySchDList) {
					Map<String, Object> obj = new HashMap<>();

					if (CollectionUtils.isNotEmpty(fillFlowHis)) {
						for (FinPayDtlDTO finPayDtlDTO : fillFlowHis) {
							if(prjPrdPaySchDDTO.getId().equals(finPayDtlDTO.getPaySchDtlId())) {
								obj.put("formUrl", finPayDtlDTO.getFormUrl());
								obj.put("audStsCd", finPayDtlDTO.getAudStsCd());
								obj.put("pinstId", finPayDtlDTO.getpInstId());
								obj.put("dataId", finPayDtlDTO.getDataId());
								obj.put("pNo", finPayDtlDTO.getpNo());
							}
							 
						}
					}
					if (map.containsKey(prjPrdPaySchDDTO.getFeeTypCd())) {
						obj.put("feeTypCdNm", map.get(prjPrdPaySchDDTO.getFeeTypCd()));  
					}
					obj.put("feeTypCd", prjPrdPaySchDDTO.getFeeTypCd());
					obj.put("feeAmt", prjPrdPaySchDDTO.getFeeAmt());
					obj.put("paidUpAmt", prjPrdPaySchDDTO.getPaidUpAmt());
					obj.put("feeRem", prjPrdPaySchDDTO.getFeeRem());
					obj.put("crtTm", prjPrdPaySchDDTO.getCrtTm().getTime());
					obj.put("arAmt",prjPrdPaySchDDTO.getArAmt());
					resultList.add(obj);
			}
		}
		BaseLogUtils.info(logger, "getPaySchFeeList", "加载借款信息列表,resultList=>"+JSON.toJSONString(paySchDList) );

        return new ListPageVO<>(resultList, resultList.size());
    }

}
 